package p270jp.pxv.android.viewholder;

import android.view.View;
import java.util.List;
import p165fo.C3114c;
import p270jp.pxv.android.R;
import p270jp.pxv.android.commonObjects.model.CommentAccessType;
import p270jp.pxv.android.commonObjects.model.PixivComment;
import p270jp.pxv.android.event.LoadCommentEvent;
import p270jp.pxv.android.legacy.model.PixivIllust;
import p270jp.pxv.android.view.DetailCommentsView;
import p270jp.pxv.android.viewholder.CalcHeightViewHolder;
import p307l9.EdgeTreatment;

/* renamed from: jp.pxv.android.viewholder.DetailCommentViewHolder */
/* loaded from: classes2.dex */
public class DetailCommentViewHolder extends CalcHeightViewHolder {
    private DetailCommentsView detailCommentsView;

    /* renamed from: jp.pxv.android.viewholder.DetailCommentViewHolder$CommentItem */
    /* loaded from: classes2.dex */
    public static class CommentItem extends CalcHeightViewHolder.CalcHeightItem {
        private PixivIllust illust;
        private List<PixivComment> commentList = null;
        private CommentAccessType commentAccessType = CommentAccessType.DENY;

        public CommentItem(PixivIllust pixivIllust) {
            this.illust = pixivIllust;
        }

        public CommentAccessType getCommentAccessType() {
            return this.commentAccessType;
        }

        public List<PixivComment> getComments() {
            return this.commentList;
        }

        public PixivIllust getIllust() {
            return this.illust;
        }

        public void setCommentAccessType(CommentAccessType commentAccessType) {
            this.commentAccessType = commentAccessType;
        }

        public void setComments(List<PixivComment> list) {
            EdgeTreatment.m3909i(list);
            this.commentList = list;
        }
    }

    public DetailCommentViewHolder(View view) {
        super(view);
        this.detailCommentsView = (DetailCommentsView) view.findViewById(R.id.detail_comments_view);
    }

    public static int getLayoutRes() {
        return R.layout.view_detail_comments;
    }

    @Override // p270jp.pxv.android.viewholder.BaseViewHolder
    public void bind(Object obj) {
        super.bind(obj);
        CommentItem commentItem = (CommentItem) obj;
        C3114c.m6284b().m6280f(new LoadCommentEvent(commentItem.getIllust().f19079id));
        List<PixivComment> comments = commentItem.getComments();
        if (comments != null) {
            this.detailCommentsView.m4502a(commentItem.getIllust(), comments, commentItem.getCommentAccessType());
        }
        postCalcViewHeight(commentItem);
    }
}
